package cn.cefoc.feign;

import cn.cefoc.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// contextId:一个微服务中有多个feign接口时，需要写唯一id标识，这样才不会报错
//@FeignClient(name = "user-server",contextId = "UserController")
@FeignClient(value = "user-server",fallbackFactory = UserServiceFallbackFactory.class )
public interface UserService {
    @GetMapping("/user/{id}")
    User FindUserById(@PathVariable("id") Long id);
}
